<?php

namespace App\Http\Requests\Admin\Panx\Customer;

use App\Http\Requests\ApiRequest;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;

/**
 * @property int provider_type
 * @property int show_virtual
 * @property int is_deleted
 * @property int per_page
 * @property int has_hair
 * @property int keyword
 * @property string is_debug
 */
class CustomerIndexRequest extends ApiRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'provider_type' => ['nullable', 'int', Rule::in([1, 2, 3])],
            'show_virtual'  => ['nullable', 'int', Rule::in([0, 1])],
            'is_deleted'    => ['nullable', 'int', Rule::in([0, 1])],
            'has_hair'      => ['nullable', 'int', Rule::in([0, 1])],
            'is_debug'      => ['nullable', 'int', Rule::in([0, 1])],
        ];
    }

    /**
     * @return array
     */
//    public function messages()
//    {
//        return [
//            'provider_type.*' => '代理客户的类型是1,2或3',
//            'show_virtual.*'  => '代理客户的商品是否展示，值是0或1',
//            'is_deleted.*'    => '代理客户的状态值是0或1',
//            'has_hair.*'      => '代理客户是否开通发型试戴服务值是0或1',
//        ];
//    }
}
